#include <iostream>
#include <unistd.h>
#include <vector>
#include <string>
#include <thread>
#include <pthread.h>


// void thread_run(std::string name, int num)
// {
//     while (num)
//     {
//         std::cout << name << " , num: " << num-- << std::endl;
//         sleep(1);
//     }
// }

void thread_run(int num)
{
    while (num)
    {
        std::cout << "thread_1 , num: " << num-- << std::endl;
        sleep(1);
    }
}


int main()
{
    // std::string name = "thread_1";
    std::thread mythread(thread_run, 3);
    while (true)
    {
        std::cout << "main thread run..." <<std::endl;
        sleep(1);
    }

    mythread.join();
    return 0;
}

